package com.yowasa.xiuxian.engine.travel.adventure;

import com.google.common.collect.Sets;
import com.yowasa.xiuxian.engine.travel.AdventureInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.MapEnum;
import com.yowasa.xiuxian.entity.enums.RefreshType;
import com.yowasa.xiuxian.service.helper.ItemHelper;
import com.yowasa.xiuxian.service.helper.ResourceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Set;

/**
 * 金陵大厨 一次刷新仅能被触发一次
 * 上架一个鲜香锅巴
 */
@Component
public class ChiReYuJingADV implements AdventureInterface {


    @Autowired
    private ResourceHelper resourceHelper;
    @Autowired
    private ItemHelper itemHelper;

    @Override
    public Set<MapEnum> limitMaps() {
        //程曦
        return Sets.newHashSet(MapEnum.CHENG_XI_JIU_ZHUANG);
    }

    public boolean limitCheck(UserBO user) {
        return resourceHelper.checkHaveResource(user.getGuildId(), this.getClass().getName(), RefreshType.LOCK_TIME);
    }

    @Override
    public String exec(UserBO user) {
        resourceHelper.lockResource(user.getGuildId(), this.getClass().getName(), 10 * 360);
        itemHelper.addItem(user, "炙热余烬秘籍", 1);
        String msg = "晨曦酒庄依旧灯火通明，却少了当年的一丝温情。你与迪卢克老爷相遇在当年大战魔龙乌萨的小路上，与迪卢克老爷交谈后，他给了你一本秘籍，希望你能继承其父之志，继续保护着蒙德的人民。\n" +
                "获得了战技[炙热余烬]的秘籍";
        return msg;
    }

}
